//
//  SmallCollectionViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "SmallCollectionViewCell.h"

@implementation SmallCollectionViewCell
- (void)dealloc
{
    [_des_s release];
    [_title_s release];
    [_img_s release];
    [_blackView release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //imgview
        self.img_s = [[ UIImageView alloc] init];
        _img_s.backgroundColor = [ UIColor grayColor];
        [self.contentView addSubview:_img_s];
        [_img_s release];
        
        //titlel
        self.title_s =[[  UILabel alloc] init];
        // _title.backgroundColor = [ UIColor greenColor];
        [self.img_s addSubview:_title_s];
        [_title_s release];
        _des_s.font =[ UIFont systemFontOfSize:13];
        _title_s.textAlignment = NSTextAlignmentRight;
        self.des_s = [[ UILabel alloc] init];
        [self.img_s addSubview:_des_s];
        _des_s.textAlignment = NSTextAlignmentRight;
        
        self.blackView = [[UIView alloc] init];
        [self.blackView setBackgroundColor:[UIColor blackColor]];
        [self.img_s addSubview:self.blackView];
        self.blackView.alpha = 0.5;
        
        self.img_s .userInteractionEnabled = YES;
        self.blackView.userInteractionEnabled = NO;
         self.blackView.hidden = NO;
        [_blackView release];
        
        
    }
    return self;
}

//布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _img_s.frame = CGRectMake(0, 0, layoutAttributes.size.width , layoutAttributes.size.height );
    _title_s.frame = CGRectMake(0, _img_s.frame.size.height - 80*HEIGHT , layoutAttributes.size.width , 20 *HEIGHT);
    _des_s.frame = CGRectMake(0, _img_s.frame.size.height - 60 *HEIGHT, layoutAttributes.size.width, HEIGHT*20);
    self.blackView.frame = CGRectMake(0, 0, layoutAttributes.size.width , layoutAttributes.size.height);
    
}

@end
